﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>無題のページ</title>
<style type="text/css">
#editor {
    border: solid 1px red;
    overflow:auto;
    position:absolute;
    top:10px;left:10px;width:600px;height:300px;
    line-height:20px;
    line-spacing: 0px;
    padding:0px;
    margin:0px;
}

p {
    margin:0px;
    line-height:20px;
}
</style>
</head>
<body>
<div id ="editor" onkeypress="checkContent()" contenteditable="true">
Edit me
</div>

<script type="text/javascript">

function checkContent() {
    document.selection.createRange()   
}
</script>

</body>
</html>
